package com.atbeijing.bigdata.spark.mytest.core

import org.apache.spark.rdd.RDD
import org.apache.spark.{HashPartitioner, SparkConf, SparkContext}


object Operator3 {
  def main(args: Array[String]): Unit = {
    val conf: SparkConf = new SparkConf().setMaster("local[*]").setAppName("groupBy")
    val sc = new SparkContext(conf)

    val list = List(1,2,3,4)
    // 集合头
    println("head => " + list.head)
    // 集合尾
    println("tail => " + list.tail)
    // 集合尾迭代
    println("tails => " + list.tails.toList)
    // 集合初始值
    println("init => " + list.init)
    // 集合初始值迭代
    println("inits => " + list.inits.toList)
    // 集合最后元素
    println("last => " + list.last)


  }
}
